#include <iostream>
#include <string>

using namespace std;

bool judge(string &a)
{
    int left = 0, right = a.size() - 1;
    while (left <= right)
    {
        if (a[left] != a[right])
        {
            return false;
        }
        ++left;
        --right;
    }
    return true;
}

int main()
{
    string a, b;
    int count;
    cin >> a >> b;
    for (int i = 0; i < a.size(); ++i)
    {
        a.insert(i, b);
        if (judge(a))
        {
            count++;
        }
        a.erase(i, b.size());
    }
    cout << count;
    return 0;
}